﻿@using GSLMS.Entity
@using GSLMS.Entity.Enum
@model IEnumerable<GSLMS.Entity.TB_ADU_CONARR>
@{
    Layout = null;
    int i = 1;
    var SearchParma = ViewData["SearchParma"] as GSLMS.Entity.TB_ADU_CONARR ?? new GSLMS.Entity.TB_ADU_CONARR();
    var systemID = ViewData["systemID"] as SelectList;
   
    SearchParma.DirectorAuditTime = DateTime.Now.AddMonths(-1);
    SearchParma.DirectorAuditTime_End = DateTime.Now;    
}
<form id="pagerForm" method="get" action="RiskAudit/AuditCon/AuditConSum/index?action=page&OpID=@ViewData["OperateID"]">
<input type="hidden" name="pageNum" value="1" />
<input type="hidden" name="numPerPage" value="@ViewData["pageSize"]" />
<input type="hidden" name="RowCount" value="@ViewData["RowCount"]" />
<input type="hidden" name="CustName" value="@SearchParma.CustName" />
<input type="hidden" name="SystemID" value="@SearchParma.SystemID" />
<input type="hidden" name="STATUS"  value="@SearchParma.STATUS" />
<input type="hidden" name="STATUS2" value="@SearchParma.STATUS2" />
</form>
<div class="pageHeader">
    <form onsubmit="return navTabSearch(this)" id="Form_@ViewData["CurrentController"]" action="RiskAudit/AuditCon/AuditConSum/index?action=search&OpID=@ViewData["OperateID"]"
    method="post">
    <div class="searchBar">
        <table class="searchContent">
            <tr>
                <th>
                    客户名称：
                </th>
                <td>
                    @Html.TextBox("CustName", SearchParma.CustName, new { @style="width:100px;"})
                </td>
                <th>
                    来源：
                </th>
                <td>
                    @Html.DropDownList("SystemID", systemID, GSLMS.WebAPP.HelperCommon.SelectDefaultValue, new { @style = "width:80px;" })
                </td>
                 <th>
                    风控通过日期：
                </th>
                <th>
                   @Html.TextBox("DirectorAuditTime", SearchParma.DirectorAuditTime, new { @class = "date", @style = "width:70px;", format = "yyyy-MM-dd", @maxDate = "%y-%M-%d", @readonly = "true", formatDate = "yyyy-MM-dd" })
                </th>
                <th colspan="3">
                    ~
                    @Html.TextBox("DirectorAuditTime_End", SearchParma.DirectorAuditTime_End, new { @class = "date", @style = "width:70px;", format = "yyyy-MM-dd", @maxDate = "%y-%M-%d", @readonly = "true", formatDate = "yyyy-MM-dd" })
                  
                </th>
                <th>
                    &nbsp;&nbsp;处理状态:
                </th>
                <td>
                     <input type="checkbox" name="STATUS" value="1" @(SearchParma.STATUS==1?"checked='checked'":"")  /><span>待汇总
                    </span>
                     <input type="checkbox" name="STATUS2" value="1" @(SearchParma.STATUS2== 1 ? "checked='checked'" : "") />
                    <span>已汇总
                    </span>
                </td>
                <td align="right">
                    <div class="subBar">
                        <ul>
                            <li>
                                <div class="buttonActive">
                                    <div class="buttonContent">
                                        <button type="submit" name="submit">
                                            检索</button></div>
                                </div>
                            </li>
                            <li>
                                <div class="buttonActive">
                                    <div class="buttonContent">
                                        <button type="reset" name="reset">
                                            重置</button></div>
                                </div>
                            </li>
                        </ul>
                    </div>
                </td>
            </tr>
        </table>
    </div>
    </form>
</div>
<div class="pageContent">
    @Html.Partial("Buttons")
    <table class="list" layouth="95" id="tableDirectorConSumList">
        <thead>
            <tr class="header">
                <th style="width:60px;">
                    来源
                </th>
                <th style="width:135px;">
                    客户名称
                </th>
                <th style="width:80px;">
                    申请编号
                </th>
                <th style="width:80px;">
                    业务类别
                </th>
                <th style="width:100px;">
                   申请额度(万元)
                </th>
                <th style="width:100px;">
                    风控通过日期
                </th>
                <th style="width:100px;">
                    审议安排日期
                </th>
                <th style="width:80px;">
                    客户经理
                </th>
                <th style="width:80px;">
                    处理状态
                </th>
            </tr>
        </thead>

        @if (Model != null)
        {
            foreach (var item in Model)
            {            
            <tr target="DirectorCoArr_ID" rel="@item.PROID" STATUS="@item.STATUS" ConSumflag="@item.ConSumflag">
                <td>
                   @((ApplyEnum.RegSystemID)item.SystemID)
                </td>
                <td>
                    @item.CustName
                </td>
                <td>
                   <a href="DianDang/Apply/ProInfo/Details/@item.PROID?OpID=@ViewData["OperateID"]" Target="dialog" rel="AuditConSumV"  title="查看立项申请【@item.CustName】">
                        @item.ApplyNo
                    </a>
                </td>
                <td style="text-align:center;">
                    @((ApplyEnum.RegBussType)item.BussType)
                </td>
                <td style="text-align:right;">@item.Amount.ToString("N")
                </td>
                <td style="text-align:center;">@(item.DirectorAuditTime.Value.ToString("yyyy-MM-dd HH:mm:ss"))
                </td>
                <td style="text-align:center;">
                   @(item.STATUS > -1 ? item.ARRDATE.Value.ToString("yyyy-MM-dd HH:mm:ss") : "")
                </td>
                <td style="text-align:center;">
                    @item.SalesMan
                </td>
                <td style="text-align:center;">
                    @(item.ConSumflag==0 ? "待汇总" : "已汇总")
                </td>
            </tr>
                i += 1;
            }
        }
    </table>
</div>
@Html.Partial("PageBar")
<script type="text/javascript">
    function CreateConSum(obj) {
        $this = $(obj);
        var id = $("#tableDirectorConSumList").find(".selected").attr("rel");
        if (id) {
            var ConSumflag = $("#tableDirectorConSumList").find(".selected").attr("ConSumflag");
            var url = "RiskAudit/AuditCon/AuditConSum/Create/" + id + "?consumflag=" + ConSumflag;
            if (ConSumflag == 1)
                url = "RiskAudit/AuditCon/AuditConSum/VConSum/" + id 
            var title = "审议汇总"
            var rel = "RiskAudit_AuditCon_AuditConSum_1";
            var options = {max:true};
            $.pdialog.open(url, rel, title, options);
        }
        else {
            alertMsg.error("请选择一条记录");
        }
    }
    

    
</script>
